<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset='utf-8'>
</head>
    <style type="text/css">
        #list li{
            width: 400px;
            height: 40px;
            line-height: 40px;
            border-bottom: 1px solid #999;
        }
    </style>
<body>
        <ul id="list">
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
        </ul>


        <button onclick="ck(this)" id="btn">床前明月光,地上鞋两双</button>
</body>



    <script>
        var list = document.getElementById("list");
        var lis = list.getElementsByTagName("li");

        for(var i=0;i<lis.length;i++)
        {
            
            lis[i].onclick = function(){

                // alert(lis[i].innerHTML);
                alert(this.innerHTML);
            }
        }

        var btn = document.getElementById("btn");

        function ck(obj)
        {
            alert(obj.innerHTML);
            //alert(btn.innerHTML);
        }
    </script>
</html>